﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="BusinessDevelopmentActivity.cs" company="DissingNelleman">
//   
// All rights reserved. </copyright>
// <summary>
//   The business development activity.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace ServiceLibrary.Models.Domain
{
    using System.Collections.Generic;

    using NHibernate.Mapping.ByCode.Conformist;

    using ServiceLibrary.Models.Base;

    /// <summary>
    /// The business development activity.
    /// </summary>
    public class BusinessDevelopmentActivity : Entity
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="BusinessDevelopmentActivity"/> class.
        /// </summary>
        public BusinessDevelopmentActivity()
        {
            this.Topics = new HashSet<Topic>();
        }

        #endregion

        #region Public Properties

        /// <summary>
        /// Gets or sets the additional comments.
        /// </summary>
        public virtual string AdditionalComments { get; set; }

        /// <summary>
        /// Gets or sets the topic elaboration.
        /// </summary>
        public virtual string TopicElaboration { get; set; }

        /// <summary>
        /// Gets or sets the topics.
        /// </summary>
        public virtual ICollection<Topic> Topics { get; set; }

        #endregion
    }

    /// <summary>
    /// The business development activity mapping.
    /// </summary>
    public class BusinessDevelopmentActivityMapping : ClassMapping<BusinessDevelopmentActivity>
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="BusinessDevelopmentActivityMapping"/> class.
        /// </summary>
        public BusinessDevelopmentActivityMapping()
        {
            this.Property(x => x.AdditionalComments, m => m.Length(int.MaxValue / 2));
            this.Property(x => x.TopicElaboration, m => m.Length(int.MaxValue / 2));
            this.Set(x => x.Topics, c => { }, m => m.ManyToMany());
        }

        #endregion
    }
}